<?php
include_once( "common.php" );
checkLogin( STATUS_ADMIN );

# Delete the bug and its comments
if ( isValidEntry( "Bug", $_GET["id"] ) )
{
    db_query( "DELETE FROM Log WHERE Log.bug = {$_GET["id"]}" ) or outputAlert( "Database error", "A database error occurred and the logs for this bug were not deleted." );
    db_query( "DELETE FROM Bug WHERE Bug.id = {$_GET["id"]}" ) or outputAlert( "Database error", "A database error occurred and the bug was not deleted." );
}

header( "Location: main.php" );
?>
